package events;

import java.util.EventObject;

import p2pmodule.ClientTransfer;

/**
 * This event will be raised when a download from the P2P network has finished.
 * 
 * @author ole
 */
public class FileDownloadedEvent extends EventObject {
	// Class constants.
	private static final long serialVersionUID = 1L;
	
	// Class attributes.
	private String fname = null;

	/**
	 * Class constructor.
	 * 
	 * @param source:
	 * 		The Object that raised the event.
	 * @param fname:
	 * 		The filename of the file already downloaded.
	 */
	public FileDownloadedEvent(ClientTransfer source, String fname) {
		super(source);
		this.fname = fname;
	}
	
	/**
	 * Returns the name of the file already downloaded.
	 *  
	 * @return:
	 * 		A string with the name of the file downloaded.
	 */
	public String getFileName() {
		return fname;
	}
}
